﻿@{
    ViewBag.Title = "Accesories List";
    ViewBag.Header = "Accessory";
    ViewBag.Caption = "Listing";
    ViewBag.AddNewUrl = Url.Action("AccessoryMaintenance", "Product");
    ViewBag.XlsUrl = Url.Action("Export", "Accessory", new { type = "Excel" });
    ViewBag.PdfUrl = Url.Action("Export", "Accessory", new { type = "Pdf" });
    ViewBag.PrintUrl = Url.Action("Print", "Accessory");
}
<div id="listing_Laptops">
    <div class="box">
        <div class="box-body table-responsive">
            <table id="dt_Grid" class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th>Accessory</th>
                        <th>Brand</th>
                        <th>Model#</th>
                        <th>MRP</th>
                        <th>&nbsp;</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <tbody id="dt_Rows"></tbody>
            </table>
        </div>
    </div>
</div>

<script id="dataTable_Grid" type="text/x-jquery-tmpl">
    <tr>
        <td>${AccessoryType}</td>
        <td>${Manufacture}</td>
        <td>${ModelNumber}</td>
        <td>${MRP}</td>
        <td><a href='@Url.Action("AccessoryMaintenance")?Id=${Id}'>Edit</a></td>
        <td><a href='@Url.Action("AccessoryDelete")?Id=${Id}'>Delete</a></td>
    </tr>
</script>

<script type="text/javascript">
    $(document).ready(function () {
        $.getJSON('@Url.Action("GetAccessories", "Product")', function (result) {
            $.tmpl($('#dataTable_Grid'), result).appendTo('#dt_Rows');

            $('#dt_Grid').dataTable({
                "bPaginate": true,
                "bLengthChange": true,
                "bFilter": true,
                "bSort": true,
                "bInfo": true,
                "bAutoWidth": false
            });

        });
    });

</script>


